CREATE TABLE [dbo].[TDDIST_COPA]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[TI_COMP_PAGO] [dbo].[TD_VC_003] NOT NULL,
[NU_COMP_PAGO] [dbo].[TD_VC_008] NOT NULL,
[NU_CORR] [dbo].[TD_IN_001] NOT NULL CONSTRAINT [DF__TDDIST_CO__NU_CO__3C1FE2D6] DEFAULT ((0)),
[TI_AUXI_EMPR] [dbo].[TD_VC_001] NULL,
[CO_AUXI_EMPR] [dbo].[TD_VC_020] NULL,
[CO_CNTA_EMPR] [dbo].[TD_VC_020] NULL,
[CO_ORDE_SERV] [dbo].[TD_VC_020] NULL,
[ST_DIST] [dbo].[TD_VC_001] NOT NULL,
[PO_DIST] [dbo].[TD_NU_009_004] NOT NULL CONSTRAINT [DF__TDDIST_CO__PO_DI__3D14070F] DEFAULT ((0)),
[IM_CUOT_DIST] [dbo].[TD_NU_016_004] NOT NULL CONSTRAINT [DF__TDDIST_CO__IM_CU__3E082B48] DEFAULT ((0)),
[CO_UNID_CONC] [dbo].[TD_VC_003] NULL,
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TDDIST_CO__CO_US__3EFC4F81] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TDDIST_CO__FE_US__3FF073BA] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TDDIST_CO__CO_US__40E497F3] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TDDIST_CO__FE_US__41D8BC2C] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TDDIST_COPA] ADD CONSTRAINT [PK__TDDIST_C__703171885A653E2B] PRIMARY KEY CLUSTERED  ([CO_EMPR], [TI_COMP_PAGO], [NU_COMP_PAGO], [NU_CORR]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TDDIST_COPA] ADD CONSTRAINT [FK__TDDIST_COPA__4C02103B] FOREIGN KEY ([CO_EMPR], [TI_COMP_PAGO], [NU_COMP_PAGO]) REFERENCES [dbo].[TCCOMP_PAGO] ([CO_EMPR], [TI_COMP_PAGO], [NU_COMP_PAGO])
GO
